﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FPC.Offer.Repository
{
    public class System_PowerTableRepository : BaseRepository<Model.System_PowerTable>, IRepository.ISystem_PowerTableRepository
    {
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="GetId"></param>
        /// <returns></returns>
        public dynamic PowerBatchDelete(string GetId) {
            return base.DbContext.Database.ExecuteSqlCommand("DELETE FROM [FPC_Offer].[dbo].[System_PowerTable] WHERE PowerId in ("+GetId+")");
        }
        /// <summary>
        /// 权限模糊查询
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public dynamic PowerLikeShow(string name) {
            return base.DbContext.Database.SqlQuery<Model.System_PowerTable>("SELECT [PowerId]      ,[PowerName]      ,[PowerAddress]      ,[PowerSublevelId]      ,[PowerRemarks]      ,[PowerPhoto]  FROM [FPC_Offer].[dbo].[System_PowerTable] where PowerName like '%"+name+"%'").ToList();
        }

    }
}
